﻿<!DOCTYPE html>
<html lang="en">

<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>学校食堂安全管理系统v1.0</title>

    <!-- Bootstrap Core CSS -->
    <link href="../vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">

    <!-- MetisMenu CSS -->
    <link href="../vendor/metisMenu/metisMenu.min.css" rel="stylesheet">

    <!-- DataTables CSS -->
    <link href="../vendor/datatables-plugins/dataTables.bootstrap.css" rel="stylesheet">

    <!-- DataTables Responsive CSS -->
    <link href="../vendor/datatables-responsive/dataTables.responsive.css" rel="stylesheet">

    <!-- Custom CSS -->
    <link href="../dist/css/sb-admin-2.css" rel="stylesheet">

    <!-- Custom Fonts -->
    <link href="../vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link rel="stylesheet" type="text/css" href="../dist/css/extendcss.css" />
    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
        <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->

</head>

<body>
    <div id="wrapper">
        <!-- Navigation -->
        <nav class="navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                    <span class="sr-only">Toggle </span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
            </div>
            <!-- /.navbar-header -->

            <ul class="nav navbar-top-links navbar-right">
                <li class="dropdown">
                    <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                        <i class="fa fa-envelope fa-fw"></i> <i class="fa fa-caret-down"></i>
                    </a>
                    <ul class="dropdown-menu dropdown-messages">
                        <li>
                            <a href="#">
                                <div>
                                    <strong>John Smith</strong>
                                    <span class="pull-right text-muted">
                                        <em>Yesterday</em>
                                    </span>
                                </div>
                                <div>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eleifend...
                                </div>
                            </a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a href="#">
                                <div>
                                    <strong>John Smith</strong>
                                    <span class="pull-right text-muted">
                                        <em>Yesterday</em>
                                    </span>
                                </div>
                                <div>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eleifend...
                                </div>
                            </a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a href="#">
                                <div>
                                    <strong>John Smith</strong>
                                    <span class="pull-right text-muted">
                                        <em>Yesterday</em>
                                    </span>
                                </div>
                                <div>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eleifend...
                                </div>
                            </a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a class="text-center" href="#">
                                <strong>Read All Messages</strong>
                                <i class="fa fa-angle-right"></i>
                            </a>
                        </li>
                    </ul>
                    <!-- /.dropdown-messages -->
                </li>
                <!-- /.dropdown -->
                <li class="dropdown">
                    <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                        <i class="fa fa-tasks fa-fw"></i> <i class="fa fa-caret-down"></i>
                    </a>
                    <ul class="dropdown-menu dropdown-tasks">
                        <li>
                            <a href="#">
                                <div>
                                    <p>
                                        <strong>Task 1</strong>
                                        <span class="pull-right text-muted">40% Complete</span>
                                    </p>
                                    <div class="progress progress-striped active">
                                        <div class="progress-bar progress-bar-success" role="progressbar"
                                            aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: 40%">
                                            <span class="sr-only">40% Complete (success)</span>
                                        </div>
                                    </div>
                                </div>
                            </a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a href="#">
                                <div>
                                    <p>
                                        <strong>Task 2</strong>
                                        <span class="pull-right text-muted">20% Complete</span>
                                    </p>
                                    <div class="progress progress-striped active">
                                        <div class="progress-bar progress-bar-info" role="progressbar"
                                            aria-valuenow="20" aria-valuemin="0" aria-valuemax="100" style="width: 20%">
                                            <span class="sr-only">20% Complete</span>
                                        </div>
                                    </div>
                                </div>
                            </a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a href="#">
                                <div>
                                    <p>
                                        <strong>Task 3</strong>
                                        <span class="pull-right text-muted">60% Complete</span>
                                    </p>
                                    <div class="progress progress-striped active">
                                        <div class="progress-bar progress-bar-warning" role="progressbar"
                                            aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%">
                                            <span class="sr-only">60% Complete (warning)</span>
                                        </div>
                                    </div>
                                </div>
                            </a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a href="#">
                                <div>
                                    <p>
                                        <strong>Task 4</strong>
                                        <span class="pull-right text-muted">80% Complete</span>
                                    </p>
                                    <div class="progress progress-striped active">
                                        <div class="progress-bar progress-bar-danger" role="progressbar"
                                            aria-valuenow="80" aria-valuemin="0" aria-valuemax="100" style="width: 80%">
                                            <span class="sr-only">80% Complete (danger)</span>
                                        </div>
                                    </div>
                                </div>
                            </a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a class="text-center" href="#">
                                <strong>See All Tasks</strong>
                                <i class="fa fa-angle-right"></i>
                            </a>
                        </li>
                    </ul>
                    <!-- /.dropdown-tasks -->
                </li>
                <!-- /.dropdown -->
                <li class="dropdown">
                    <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                        <i class="fa fa-bell fa-fw"></i> <i class="fa fa-caret-down"></i>
                    </a>
                    <ul class="dropdown-menu dropdown-alerts">
                        <li>
                            <a href="#">
                                <div>
                                    <i class="fa fa-comment fa-fw"></i> New Comment
                                    <span class="pull-right text-muted small">4 minutes ago</span>
                                </div>
                            </a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a href="#">
                                <div>
                                    <i class="fa fa-twitter fa-fw"></i> 3 New Followers
                                    <span class="pull-right text-muted small">12 minutes ago</span>
                                </div>
                            </a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a href="#">
                                <div>
                                    <i class="fa fa-envelope fa-fw"></i> Message Sent
                                    <span class="pull-right text-muted small">4 minutes ago</span>
                                </div>
                            </a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a href="#">
                                <div>
                                    <i class="fa fa-tasks fa-fw"></i> New Task
                                    <span class="pull-right text-muted small">4 minutes ago</span>
                                </div>
                            </a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a href="#">
                                <div>
                                    <i class="fa fa-upload fa-fw"></i> Server Rebooted
                                    <span class="pull-right text-muted small">4 minutes ago</span>
                                </div>
                            </a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a class="text-center" href="#">
                                <strong>See All Alerts</strong>
                                <i class="fa fa-angle-right"></i>
                            </a>
                        </li>
                    </ul>
                    <!-- /.dropdown-alerts -->
                </li>
                <!-- /.dropdown -->
                <li class="dropdown">
                    <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                        <i class="fa fa-user fa-fw"></i> <i class="fa fa-caret-down"></i>
                    </a>
                    <ul class="dropdown-menu dropdown-user">
                        <li><a href="#"><i class="fa fa-user fa-fw"></i> User Profile</a>
                        </li>
                        <li><a href="#"><i class="fa fa-gear fa-fw"></i> Settings</a>
                        </li>
                        <li class="divider"></li>
                        <li><a href="login.html"><i class="fa fa-sign-out fa-fw"></i> Logout</a>
                        </li>
                    </ul>
                    <!-- /.dropdown-user -->
                </li>
                <!-- /.dropdown -->
            </ul>
            <!-- /.navbar-top-links -->

            <div class="navbar-default sidebar" role="navigation">
                <div class="sidebar-nav navbar-collapse">
                    <ul class="nav" id="side-menu">
                        <!--<li class="sidebar-search">
                            <div class="input-group custom-search-form">
                                <input type="text" class="form-control" placeholder="Search...">
                                <span class="input-group-btn">
                                <button class="btn btn-default" type="button">
                                    <i class="fa fa-search"></i>
                                </button>
                            </span>
                            </div>
                        </li>-->
                        <li>
                            <a href="#"><i class="fa fa-bar-chart-o fa-fw"></i> 库存管理<span class="fa arrow"></span></a>
                            <ul class="nav nav-second-level">
                                <li>
                                    <a href="receiptplanlist.html">进货计划</a>
                                </li>
                                <li>
                                    <a href="signlist.html">进货签收</a>
                                </li>
                                <li>
                                    <a href="boundin.html">入库管理</a>
                                </li>
                                <li>
                                    <a href="boundout.html">出库管理</a>
                                </li>
                                <li>
                                    <a href="inventory.html">盘点管理</a>
                                </li>
                            </ul>
                        </li>
                        <li>
                            <a href="#"><i class="fa fa-bar-chart-o fa-fw"></i> 供货管理<span class="fa arrow"></span></a>
                            <ul class="nav nav-second-level">
                                <li>
                                    <a href="ghsend.html">送货单管理</a>
                                </li>
                                <li>
                                    <a href="ghreceive.html">收款单管理</a>
                                </li>
                            </ul>
                            <!-- /.nav-second-level -->
                        </li>
                        <li>
                            <a href="#"><i class="fa fa-wrench fa-fw"></i> 财务管理<span class="fa arrow"></span></a>
                            <ul class="nav nav-second-level">
                                <li>
                                    <a href="cwreceive.html">收款管理</a>
                                </li>
                                <li>
                                    <a href="cwpay.html">付款管理</a>
                                </li>
                            </ul>
                        </li>
                        <li>
                            <a href="#"><i class="fa fa-wrench fa-fw"></i> 统计分析<span class="fa arrow"></span></a>
                            <ul class="nav nav-second-level">
                                <li>
                                    <a href="tjin.html">进货单查询</a>
                                </li>
                                <li>
                                    <a href="tjout.html">出库汇总表</a>
                                </li>
                                <li>
                                    <a href="tjinsum.html">入库汇总表</a>
                                </li>
                                <li>
                                    <a href="tjhasdetail.html">存货明细账</a>
                                </li>
                                <li>
                                    <a href="tjshouldpay.html"> 应付货款报告</a>
                                </li>
                                <li>
                                    <a href="tjsource.html">食材来源统计</a>
                                </li>
                            </ul>
                            <!-- /.nav-second-level -->
                        </li>
                        <li>
                            <a href="#"><i class="fa fa-sitemap fa-fw"></i>基础数据<span class="fa arrow"></span></a>
                            <ul class="nav nav-second-level">
                                <li>
                                    <a href="unitlist.html">单位管理</a>
                                </li>
                                <li>
                                    <a href="supplierlist.html">供应商管理</a>
                                </li>
                                <li>
                                    <a href="foodclasslist.html">菜品类别</a>
                                </li>
                                <li>
                                    <a href="foodlist.html">菜品管理</a>
                                </li>
                                <!--<li>
                                    <a href="#">Third Level <span class="fa arrow"></span></a>
                                    <ul class="nav nav-third-level">
                                        <li>
                                            <a href="#">Third Level Item</a>
                                        </li>
                                        <li>
                                            <a href="#">Third Level Item</a>
                                        </li>
                                        <li>
                                            <a href="#">Third Level Item</a>
                                        </li>
                                        <li>
                                            <a href="#">Third Level Item</a>
                                        </li>
                                    </ul>                                   
                                </li>-->
                            </ul>
                            <!-- /.nav-second-level -->
                        </li>
                        <li>
                            <a href="#"><i class="fa fa-files-o fa-fw"></i> 系统管理<span class="fa arrow"></span></a>
                            <ul class="nav nav-second-level">

                                <li>
                                    <a href="userlist.html">用户管理</a>
                                </li>
                                <li>
                                    <a href="editpassword.html">修改密码</a>
                                </li>
                                <li>
                                    <a href="log.html">日志管理</a>
                                </li>
                                <li>
                                    <a href="login.html">退出系统</a>
                                </li>
                            </ul>
                            <!-- /.nav-second-level -->
                        </li>
                    </ul>
                </div>
                <!-- /.sidebar-collapse -->
            </div>
            <!-- /.navbar-static-side -->
        </nav>

        <div id="page-wrapper">
            <div class="row">
                <div class="col-lg-12">
                    <div class="panel panel-default">
                        <div class="panel-heading row">
                            <div class="col-sm-6"> 当前位置: 基础数据 >供应商管理</div>
                            <div class="col-sm-6">
                                <div class="optiondiv">
                                    <button type="button" class="btn btn-primary btn-sm"
                                        id="btncreate">新增</button>&nbsp;
                                    <button type="button" class="btn btn-primary btn-sm" id="btnedit">编辑</button>&nbsp;
                                    <button type="button" class="btn btn-primary btn-sm" id="btndel">删除</button></div>
                            </div>
                        </div>
                        <!-- /.panel-heading -->
                        <div class="panel-body">
                            <table width="100%" class="table table-striped table-bordered table-hover"
                                id="dataTables-example">
                                <thead>
                                    <tr>
                                        <th class="center"><input type="checkbox" id="cball" /></th>
                                        <th class="center">单位名称</th>
                                        <th class="center">单位地址</th>
                                        <th class="center">联系人</th>
                                        <th class="center">联系电话</th>
                                        <th class="center">供货品类</th>
                                        <th class="center">结算户名</th>
                                        <th class="center">结算银行</th>
                                        <th class="center">结算账号</th>
                                    </tr>
                                </thead>
                                <!-- 2.建立空的标签盒子 -->
                                <tbody id="supbox">
                                    <!--<tr class="odd gradeX">
                                    	<td class="center"><input type="checkbox" /></td>
                                        <td>武胜县双兴商贸有限公司</td>
                                        <td>武胜县成双路1号</td>
                                        <td>张三</td>
                                        <td>15989890101</td>
                                        <td>肉类</td>                                        
                                    	<td>张三</td>
                                    	<td>农业银行</td>
                                    	<td>6222022202220220202</td>
                                    </tr>-->

                                </tbody>
                            </table>
                            <!-- /.table-responsive -->
                            <div class="row">
                                <div class="col-sm-6">
                                    <!--<div class="dataTables_info" id="dataTables-example_info" role="status" aria-live="polite">显示第 1 至 5 项记录，共 5 项</div>-->
                                </div>
                                <div class="col-sm-6">
                                    <div class="dataTables_paginate paging_simple_numbers"
                                        id="dataTables-example_paginate">
                                        <ul class="pagination">
                                            <!--<li class="paginate_button previous disabled" aria-controls="dataTables-example" tabindex="0" id="dataTables-example_previous"><a href="#">上页</a></li>
											<li class="paginate_button active" aria-controls="dataTables-example" tabindex="0"><a href="#">1</a></li>
											<li class="paginate_button next disabled" aria-controls="dataTables-example" tabindex="0" id="dataTables-example_next"><a href="#">下页</a></li>-->
                                        </ul>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <!-- /.panel-body -->
                    </div>
                    <!-- /.panel -->
                </div>

                <!-- /.col-lg-12 -->
            </div>



        </div>


    </div>
    <!-- /#wrapper -->

    <!-- jQuery -->
    <script src="../vendor/jquery/jquery.min.js"></script>
    <!--<script src="../vendor/jquery/jquery.js"></script>-->

    <!-- Bootstrap Core JavaScript -->
    <script src="../vendor/bootstrap/js/bootstrap.min.js"></script>

    <!-- Metis Menu Plugin JavaScript -->
    <script src="../vendor/metisMenu/metisMenu.min.js"></script>

    <!-- DataTables JavaScript -->
    <script src="../vendor/datatables/js/jquery.dataTables.min.js"></script>
    <script src="../vendor/datatables-plugins/dataTables.bootstrap.min.js"></script>
    <script src="../vendor/datatables-responsive/dataTables.responsive.js"></script>
    <script src="../js/common.js"></script>
    <script src="../dist/js/sb-admin-2.js"></script>
    <script src="../dist/js/sea.js"></script>
    <!-- 1.引入模板template -->
    <script src="../js/template-web.js"></script>
    <!-- 3.创建js渲染模板 -->
    <script type="text/template" id="temp">
        {{each data as value index}}
		  <tr class="odd gradeX">
			<td class="center"><input type="checkbox" class="ischeck" value="{{value._id}}"/></td>
			<td>{{value.tbunitname}}</td>
			<td>{{value.tbaddress}}</td>
			<td>{{value.tbcontact}}</td>
			<td>{{value.tbtel}}</td>
			<td>{{value.tbclass}}</td>                                        
			<td>{{value.tbusername}}</td>
			<td>{{value.tbbank}}</td>
			<td>{{value.tbbanknum}}</td>
		</tr>
		{{/each}} 
	</script>
    <script>
        /* ----------------一、功能1页面渲染----------- */
        /* 1.数据渲染
        	思路：
        		1.向后台发起请求，拿到数据
        		2数据渲染步骤
        			（1）引入模板template
        			（2）建立一个空的标签盒子
        			（3）使用each循环遍历把数据渲染到js模板中
        			（4）使用template方法把数据渲染都空的标签中
        		3.封装成函数进行多次调用
         */
        /* 渲染页面 */
        showpage()
        //封装渲染函数
        function showpage(n = 1) {
            obj = {
                n
            }
            $.get("/base/suplist", obj, function (data) { //请求数据
                var html = template("temp", {
                    data
                });
                $("#supbox").html(html);
                //pagenum(data.count)
            })
        }
        /* ---------------二、分页功能------------- */
        /* 
        	思路：1.
         */
        var allcount = 0;
        var pagenumber;
        $.get("/base/usercount", function (data) {
            //console.log(data)
            allcount = data.count;
            //console.log(allcount)
            pagenumber = Math.ceil(allcount / 5); //分页的总数---计算页面总共多少页
            //上一页
            var prevhtml = `
				<li class="paginate_button previous" aria-controls="dataTables-example" id="dataTables-example_previous"><a href="#">上页</a></li>						
			`
            //分页数目
            var html = ''; //定义一个空的html
            for (let i = 0; i < pagenumber; i++) {
                html +=
                    '<li class="paginate_button paginateuser" aria-controls="dataTables-example" ><a class="btnpagenum">' +
                    (i + 1) + '</a></li>'
            }

            //下一页
            var nexthtml = `			
				<li class="paginate_button next " aria-controls="dataTables-example" id="dataTables-example_next"><a href="#">下页</a></li>
			`;
            var allhtml = prevhtml + html + nexthtml
            $(".pagination").html(allhtml)
        })
        window.onload = function () {
            fenyeon()
        }
        /* ---------------三、模块三：新增、修改、删除------- */
        /* 1.新增 */
        seajs.use(['jquery', 'dialog-plus'], function ($, dialog) {
            $('#btncreate').on('click', function () {
                //构造表单
                jQuery.get("unitform.html", function (data) {
                    var d = dialog({
                        title: '创建供应商',
                        content: data,
                        width: 500,
                        okValue: '确 定',
                        ok: function () {
                            num = Math.ceil((allcount + 1) / 5);
                            //console.log(typeof num)
                            var tbunitname = $("#tbunitname").val(); //单位名称
                            var tbshortcode = $("#tbshortcode").val(); //单位名称
                            var tbaddress = $("#tbaddress").val(); //单位地址
                            var tbcontact = $("#tbcontact").val(); //联系人
                            var tbtel = $("#tbtel").val(); //联系电话
                            var tbclass = $("#tbclass").val(); //供货种类
                            var tbusername = $("#tbusername").val(); //结算户名
                            var tbbank = $("#tbbank").val(); //结算银行
                            var tbbanknum = $("#tbbanknum").val(); //结算银行
                            var tbsort = $("#tbsort").val(); //排序
                            //console.log(tbunitname,tbshortcode,tbaddress,tbcontact,tbtel,tbclass,tbusername,tbbank,tbbanknum,tbsort);
                            //传递的参数值
                            var obj = {
                                tbunitname,
                                tbshortcode,
                                tbaddress,
                                tbcontact,
                                tbtel,
                                tbclass,
                                tbusername,
                                tbbank,
                                tbbanknum,
                                tbsort
                            }
                            //发起请求
                            $.post("/base/addbase", obj, function (data) {
                                //console.log(data)
                                if (data == 1) {

                                    location.reload()
                                    alert("新增数据成功...")
                                    //var aa = parseInt(num-1)
                                    //console.log(typeof aa)	
                                    //console.log(aa)																						
                                    //showpage(num)	
                                    //glxs(aa)								
                                }
                            })
                        },
                        cancelValue: '取消',
                        cancel: function () {}
                    });

                    d.showModal();
                });
            });
            /* 2.修改 */
            $('#btnedit').on('click', function () {
                var onlyi = 0;
                var editid;
                $(".ischeck").each(function (i, v) {
                    if ($(this).prop("checked")) {
                        onlyi++;
                        editid = $(this).val();
                    }
                })
                if (onlyi == 1) {
                    location.href = "supplierlist.html#id=" + editid;
                    //构造表单
                    jQuery.get("suplieredit.html", function (data) {
                        var d = dialog({
                            title: '编辑单位',
                            content: data,
                            width: 500,
                            okValue: '确 定',
                            ok: function () {
                                //获取表单的值
                                var tbunitname = $("#tbunitname").val(); //单位
                                var tbaddress = $("#tbaddress").val(); //地址
                                var tbcontact = $("#tbcontact").val(); //联系人
                                var tbtel = $("#tbtel").val(); //联系电话	
                                var tbclass = $("#tbclass").val(); //供货种类	
                                var tbusername = $("#tbusername").val(); //结算户名
                                var tbbank = $("#tbbank").val(); //结算银行
                                var tbbanknum = $("#tbbanknum").val(); //结算账号
                                var editid = location.hash.split("=")[
                                    1]; //传递id值							
                                //传递的参数值
                                var obj = {
                                    tbunitname,
                                    tbaddress,
                                    tbcontact,
                                    tbtel,
                                    tbclass,
                                    editid,
                                    tbusername,
                                    tbbank,
                                    tbbanknum
                                }
                                //发起请求
                                $.post("/base/editsup", obj, function (data) {
                                    if (data == 1) {
                                        alert("修改成功")
                                        location.reload()
                                        //showpage();//修改完成刷新当前页
                                        //glxs(0)
                                    } else {
                                        alert("修改失败")
                                    }
                                })
                            },
                            cancelValue: '取消',
                            cancel: function () {}
                        });
                        d.showModal();
                    });
                } else {
                    alert("请选择一条")
                }
            });
        });


        /* 3.删除 */
        $("#btndel").click(function () {
            var iis = 0; //定义一个变量，统计需要删除的总数
            var checkarr = []; //定义一个空的数组 主要存放选择删除的id值
            $(".ischeck").each(function (i, v) { //循环遍历获取选择的id值，并添加值空数组中
                if ($(this).prop("checked")) {
                    checkarr.push($(this).val()); //添加值空数组中
                    iis++;
                }
            })
            //条件判断 如果有没有选择
            if (iis > 0) { //大于0就进行删除请求
                $.get("/base/delmore", {
                    data: checkarr
                }, function (data) {
                    console.log(data);
                    if (data == 1) {
                        alert("删除成功");
                        location.reload()
                        //showpage();
                        //glxs(0)
                    } else {
                        alert("删除失败")
                    }
                })
            } else {
                alert("请选择删除的数据")
            }
            //console.log(checkarr,iis)
        })

        /* 其他 */
        $("#cball").click(function () {
            $("input[type='checkbox']").not(this).prop("checked", $(this).prop("checked"));
        });

        seajs.config({
            alias: {
                "jquery": "jquery-1.10.2.js"
            }
        });
    </script>



</body>

</html>